<?php

session_start();

include "koneksi.php";


$id      = $_GET['id'];
$query   = "SELECT * FROM tb_materi WHERE id_materi = $id";

$hasil   = mysql_query($query);
$data    = mysql_fetch_array($hasil);

    header("Content-Disposition: attachment; filename=".$data['path']);

 
    $fp  = fopen("flash/".$data['path'], 'r');
    $content = fread($fp, filesize('flash/'.$data['path']));
    fclose($fp);
    echo $content;
    exit


?>